
package com.shycloud.mido.member.service.impl;

import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.shycloud.mido.member.api.dto.PointsLogDTO;
import com.shycloud.mido.member.api.entity.PointsLog;
import com.shycloud.mido.member.mapper.PointsLogMapper;
import com.shycloud.mido.member.service.PointsLogService;

/**
 * 积分管理
 *
 * @author LiuW
 * @date 2019-03-11 20:15:45
 */
@Service
public class PointsLogServiceImpl extends ServiceImpl<PointsLogMapper, PointsLog> implements PointsLogService {

	/**
	 * 分页查询积分信息
	 *
	 * @param page         分页对象
	 * @param pointsLogDTO 参数列表
	 * @return
	 */
	@Override
	public IPage getPointsLogPage(Page page, PointsLogDTO pointsLogDTO) {
		return baseMapper.getPointsLogPage(page, pointsLogDTO);
	}

	/**
	 * 查询今日所得积分
	 *
	 * @param reason   变更原因
	 * @param memberId 会员id
	 * @return
	 */
	@Override
	public Integer getDailyPoints(String reason, String memberId) {
		return baseMapper.getDailyPoints(reason, memberId);
	}
}
